#PASSWD=$(grep 'temporary password' /var/log/mysqld.log )

MYSQLPASSWD=`grep 'temporary password' /var/log/mysqld.log|awk '{print $NF}'`
echo MYSQLPASSWD
mysqladmin -uroot -p${MYSQLPASSWD} password "Aa123456789#"
mysql -uroot -pAa123456789# << EOF
	/*创建wordpress数据库，并设置编码*/
	create database wordpress;
	set character_set_client = utf8;
	set character_set_server = utf8;
	set character_set_connection = utf8;
	set character_set_database = utf8;
	set character_set_results = utf8;
	set collation_connection = utf8_general_ci;
	set collation_database = utf8_general_ci;
	set collation_server = utf8_general_ci;
	/*修改密码强度，并修改密码为123456*/
	set global validate_password_policy=LOW;
	set global validate_password_length=4;
	ALTER USER 'root'@'localhost' IDENTIFIED BY '123456'; 
	/*允许任意地址连接数据库*/
	use mysql;
	update user set host = '%' where user ='root';
	FLUSH PRIVILEGES;
EOF
echo "创建数据库：wordpress"
echo "mysql账号：root"
echo "mysql密码：123456"
